<#setting number_format="############.###">
<#setting boolean_format="true,false">
<#setting date_format="yyyy-MM-dd">
<#setting time_format="HH:mm:ss">
<#setting datetime_format="yyyy-MM-dd HH:mm:ss">
<#assign const="com.yangtao.prototype.common.freemarker.ConstantDirective"?new()>
<#--<#global  theme=theme!("tundra")>-->
<#global  theme=theme?default("soria")>
<#--
 | 取得时间的function，省去了各种判断
 -->
<#function getTime time="">
	<#if time?is_date>
		<#return time?datetime>
		<#else>
			<#return time>
	</#if>
</#function>

<#--
 | 取得时间的function，省去了各种判断
 -->
<#function getDate time="">
	<#if time?is_date>
		<#return time?date>
		<#else>
			<#return time>
	</#if>
</#function>

<#--
 | 画面共用头部部分
 | 创建者:杨涛 
 | 创建时间:2009-05-05 
 | 版本:1.0 
 -->
<#macro head>
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<script type="text/javascript"
	        src="${path}/js/dojo/dojo/dojo.js"
	        djConfig="parseOnLoad:true,isDebug:false">
	</script>
	<script type="text/javascript" src="${path}/js/common/common.js"></script>
	<link rel="stylesheet" href="${path}/js/dojo/dojo/resources/dojo.css">
	<link rel="stylesheet" href="${path}/js/dojo/dijit/themes/${theme}/${theme}.css">
	<link rel="stylesheet" href="${path}/css/icon.css">
	<link rel="stylesheet" href="${path}/css/dojo-moifier.css">
<#--<link rel="stylesheet" href="${path}/css/other.css">-->
	<title>基础平台</title>
</head>
</#macro>

<#--
 | 通用的HTML模板宏，加入常用的js引用和公用的部分
 | 作者: 杨涛
 | 日期: 2010-06-09
 -->
<#macro html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<@head/>
<body class="${theme}">
<div style="padding-top:1px;">
	<#nested>
</div>
</body>
</html>
</#macro>

<#macro footer>
<P id=copyRight align=center>
<div style="width:100%;text-align: center;">
	<span>版权所有</span>
	<A target=_blank>联系我们</A>
</div>
</#macro>

<#--
 | 新增，编辑，删除，导出，可根据需求进行选择
 | 创建者:杨涛
 | 修改时间:2009-07-18
 | 修改原因:增加参数
 | 版本:1.0
 -->
<#macro toolbar btnAdd=true btnEdit=true btnDelete=true btnQuery=true btnExport=false btnSave=false>
<div dojoType="dijit.Toolbar">
	<#if btnAdd>
		<div id="btnAdd" class="toolButton" dojoType="dijit.form.Button" iconClass="add">
		<@s.text name="btnAdd"/>
		</div>
	</#if>
	<#if btnEdit>
		<div id="btnEdit" class="toolButton" dojoType="dijit.form.Button" iconClass="edit">
		<@s.text name="btnEidt"/>
		</div>
	</#if>
	<#if btnDelete>
		<div id="btnDelete" class="toolButton" dojoType="dijit.form.Button" iconClass="delete">
		<@s.text name="btnDelete"/>
		</div>
	</#if>
	<#if btnExport>
		<div id="btnExport" class="toolButton" dojoType="dijit.form.Button" iconClass="export">
		<@s.text name="btnExport"/>
		</div>
	</#if>
	<#if btnSave>
		<div id="btnSave" class="toolButton" dojoType="dijit.form.Button">
		<@s.text name="btnSave"/>
		</div>
	</#if>
</div>
</#macro>

<#--
 | 居中的保存或者清空和关闭按钮
 | 创建者:杨涛
 | 创建时间:2009-05-05
 | 版本:1.0
 -->
<#macro listButton btnSave=true btnClear=true btnClose=true>
<div class="button-bar">
	<#if btnSave>
		<div type="button" dojoType="dijit.form.Button" id="btnSave">
		<@s.text name="btnSave"/>
		</div>
	</#if>
	<#if btnClear>
		<div type="reset" dojoType="dijit.form.Button" id="btnClear">
		<@s.text name="btnClear"/>
		</div>
	</#if>
	<#if btnClose>
		<div type="button" dojoType="dijit.form.Button" id="btnClose">
		<@s.text name="btnClose"/>
			<script type="dojo/method" event="onClick">
				if(parent){
				parent.closeDialog();
				return;
				}
				window.close();
			</script>
		</div>
	</#if>
</div>
</#macro>



<#--
 | 冒号
 -->
<#macro splitor>
：
</#macro>

<#--
 | 查询表单的宏
 |
-->
<#macro queryForm id="queryForm" needQueryBar=true>
<form id="queryForm" method="post" dojoType="dijit.form.Form">
	<input type="hidden" name="processType" id="processType" value="${processType!}"/>
	<#nested>
	<#if needQueryBar>
	<@querybar/>
	</#if>
</form>
</#macro>

<#--
 | 创建者:杨涛 
 | 创建时间:2010-12-29 
 | 版本:1.0 
 -->
<#macro querybar>
<div class="query-bar">
	<div type="button" dojoType="dijit.form.Button" id="btnQuery" iconClass="">
	<@s.text name="btnQuery"/>
		<script type="dojo/method" event="onClick">
			dojo.publish("btnQuery.click");
		</script>
	</div>
	<div type="reset" dojoType="dijit.form.Button" iconClass="">
	<@s.text name="btnClear"/>
	</div>
</div>
</#macro>

<#--
 | checkbox
 | 创建者:杨涛
 | 创建时间:2010-12-29
 | 版本:1.0
 -->
<#macro checkbox name="checkbox" id="checkbox" value=false checkedValue="true" disabled=false readonly=false>
<input id="${id}" name="${name}" value="${checkedValue}" dojoType="dijit.form.CheckBox"
	<#if value>
	   <#lt>checked="checked"<#rt>
	</#if>
	<#if disabled>
	   <#lt>disabled="true"<#rt>
	</#if>
	<#if readonly>
	   <#lt>readOnly="true"<#rt>
	</#if>
	<#lt> />
<input type="hidden" id="__checkbox_${id}" name="__checkbox_${name}" value="${checkedValue}"/>
</#macro>

<#--
|查询条件
| property 属性名 必须输入的参数
| index    顺序号 可选参数，但是要保证它不重复
| id       每个输入项的Id，可选参数，但是在使用dojo的情况下，要保证它不重复
| type     输入框的类型，这个类型是指的dojo的类型。
|            大体来说分为，文本，下拉单，日期输入框，数字输入框 ，复选框，单选框 这几种
-->
<#macro seniorQuery property index=0 id="id" type="text">
<div class="cell-single-line">
	<div class="label">
		<label for="${id}"><@s.text name="${property}"/>：</label>
	</div>
	<div class="content">
		<input type="hidden" name="condition[${index}].propertyName" value="${property}"/>
		<select id="__select_${id}" name="condition[${index}].operator" dojoType="dijit.form.Select">
			<option value="LIKE">模糊查询</option>
			<option value="EQ">相等</option>
			<option value="LT">小于</option>
			<option value="GT">大于</option>
			<option value="LE">小于等于</option>
			<option value="GE">大于等于</option>
			<option value="NE">不等于</option>
			<option value="IN">等于多个</option>
			<option value="BETWEEN">范围</option>
		</select> &nbsp;
	<#--根据类型决定输入控件的类型-->
		<#local controlType = "dijit.form.TextBox">
		<#if type=="number">
			<#local controlType="dijit.form.NumberTextBox">
			<#elseif type="date">
				<#local controlType="dijit.form.DateTextBox">
			<#elseif type="combo">
				<#local controlType="dojo.form.ComboBox">
			<#elseif type="checkbox">
				<#local controlType="dojo.form.CheckBox">
			<#elseif type="radio">
				<#local controlType="dojo.form.Radio">
		</#if>
		<input id="${id}" name="condition[${index}].value" dojoType="${controlType}"/>
	</div>
</div>
<script type="text/javascript">
	dojo.ready(function() {
		dojo.connect(dijit.byId("__select_${id}"), "onChange", function() {
			var operator = dijit.byId("__select_${id}").value;
			if (operator == "BETWEEN") {
				var newObj = new ${controlType}({
					id:"${id}Max",
					name:"condition[${index}].value2"});
				newObj.placeAt(dijit.byId("${id}").domNode, "after");
			} else {
				if (typeof(dijit.byId("${id}Max")) != "undefined") {
					dijit.byId("${id}Max").destroy();
				}
			}
		});
	})
</script>
</#macro>